using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;

namespace Krile.Forms.Dialogs.Show
{
    public partial class Authorize : Form
    {
        /// <summary>
        /// Plugin name
        /// </summary>
        public string PluginName
        {
            get { return pluginName.Text; }
            set { pluginName.Text = value; }
        }

        /// <summary>
        /// plugin Path
        /// </summary>
        public string PluginPath
        {
            get { return pluginPath.Text; }
            set { pluginPath.Text = value; }
        }

        /// <summary>
        /// plugin Class
        /// </summary>
        public string PluginClass
        {
            get { return pluginClass.Text; }
            set { pluginClass.Text = value; }
        }

        /// <summary>
        /// plugin Description
        /// </summary>
        public string PluginDescription
        {
            get { return pluginDescription.Text; }
            set { pluginDescription.Text = value; }
        }

        internal Cores.PluginData PluginData
        {
            set
            {
                PluginName = value.Name;
                PluginPath = value.FilePath;
                PluginClass = value.ClassName;
                PluginDescription = value.Description;
            }
        }

        public Authorize()
        {
            InitializeComponent();
        }

        private void titlePanel_Paint(object sender, PaintEventArgs e)
        {
            Rectangle rect1 = titlePanel.ClientRectangle;
            rect1.Height /= 2;
            Rectangle rect2 = titlePanel.ClientRectangle;
            rect2.Height /= 2;
            rect2.Y = rect1.Height;

            using (LinearGradientBrush lgb = new LinearGradientBrush(rect1, Color.LimeGreen, Color.ForestGreen, LinearGradientMode.Vertical))
            {
                //lgb.GammaCorrection = true;
                e.Graphics.FillRectangle(lgb, rect1);
            }

            using (LinearGradientBrush lgb = new LinearGradientBrush(rect2, Color.DarkGreen, Color.Green, LinearGradientMode.Vertical))
            {
                lgb.GammaCorrection = true;
                e.Graphics.FillRectangle(lgb, rect2);
            }
        }
    }
}